﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SklepISI.Core.Models;

namespace SklepISI.Web.Models.Admin
{
    public class OrderDetailViewModel
    {
        public OrderModel Order { get; set; }

        public decimal TotalAmount
        {
            get
            {
                decimal amount = 0;

                foreach (var p in Order.Products)
                {
                    amount += p.Product.Price*p.Quantity;
                }

                return amount;
            }
        }

        public IList<OrderStatusModel> OrderStatuses { get; set; }
    }
}